package mercurius.fitness.client.rb.user.forms;

import com.google.gwt.user.client.rpc.AsyncCallback;

import mercurius.fitness.client.locale.Locale;
import mercurius.fitness.client.rb.user.User;
import mercurius.fitness.client.rb.user.UserRB;
import net.pleso.framework.client.bl.forms.IAddForm;
import net.pleso.framework.client.bl.forms.items.IFormItemsGroup;
import net.pleso.framework.client.dal.IDataRow;

public class AddUserForm extends UserForm implements IAddForm {

	public AddUserForm() {
		
	}
	
	public IDataRow createEmptyRow() {
		User e = new User();
		//e.setDate(new Date());
		//e.setDistanceUnit("1");
		//e.setSpeedUnit("1");
		//e.setDuration("1:00:00");
		//e.setActivity("Mixed;");
		return e;
	}

	public void addRow(IDataRow row, AsyncCallback callback) {
		UserRB.getDataSet().add((User) row, callback);
	}

	public String getCaption() {
		return Locale.constants().add_user_caption();
	}

	public IFormItemsGroup[] getGroups() {
		return groups;
	}
}
